package sel.me.spring.propertyplaceholder;

import org.springframework.util.PropertyPlaceholderHelper;

public class PropertyResolver {
	
	public static void main(String[] args) {
//    	AbstractPropertyResolver
    	
    	String text = "${foo}";
    	PropertyPlaceholderHelper helper = new PropertyPlaceholderHelper("${", "}");
//    	helper.
    	
    	String real = helper.replacePlaceholders(text, new PropertyPlaceholderHelper.PlaceholderResolver() {
    		
    		
    		@Override
            public String resolvePlaceholder(String placeholderName) {
                if ("foo".equals(placeholderName)) {
                    return "bar";
                }
                else {
                    return null;
                }
            }
        });
    	
    	System.out.println(real);
	}
}
